import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 * @author CoderXshuai
 * @date 2021/8/3 21:52
 */
public class RationalSum {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int nums = Integer.parseInt(reader.readLine());
        int[] numerat = new int[nums];
        int[] denominat = new int[nums];
        String[] temp;
        int pre = 1;
        String arr = reader.readLine();
        String[] dec = arr.split(" ");
        for (int i = 0; i < nums; i++) {
            temp = dec[i].split("/");
            numerat[i] = Integer.parseInt(temp[0]);
            denominat[i] = Integer.parseInt(temp[1]);
            pre = mul(pre, denominat[i]);
        }
        for (int i = 0; i < nums; i++) {
            numerat[i] = pre / denominat[i] * numerat[i];
        }
        int numSum = Arrays.stream(numerat).sum();
        int intValue = numSum / pre;
        int a = numSum - intValue * pre;
        int common = gcd(a, pre);
        int n = a / common;
        int d = pre / common;
        if (intValue != 0) {
            System.out.print(intValue);
            if (n != 0) {
                if (d < 0)
                    System.out.print(" -");
                else
                    System.out.print(" ");
                System.out.print(n);
                if (d != 1)
                    System.out.print("/" + Math.abs(d));
            }
        } else {
            if (n != 0) {
                if (d < 0)
                    System.out.print("-");
                System.out.print(n);
                if (d != 1)
                    System.out.print("/" + Math.abs(d));
            } else
                System.out.println(0);
        }
//        System.out.print();
        reader.close();
    }

    public static int gcd(int a, int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    public static int mul(int a, int b) {
        return a * b / gcd(a, b);
    }
}
